<template>
<div>
  <el-container>
    <el-aside width="100%" style="margin-left: 30px" >
      <div style="font-size: 20px; color: #409EFF; margin-top: 0px"></div>
      <div>
        <el-table
      :data="tableData"
      style="width: 100%">
      <el-table-column 
        prop="demand_title"
        label="需求标题"
        width="280">
      </el-table-column>
      <el-table-column 
        prop="demand_instructions"
        label="说明"
        width="280">
      </el-table-column>
       <el-table-column 
        prop="status"
        label="发布状态"
        width="280">
      </el-table-column>
      <el-table-column
        prop="date"
        label="结束日期"
        width="180">
      </el-table-column>
    </el-table>
    <div>
      <el-table
      :data="tableData"
      style="width: 100%">
      <el-table-column 
        prop="demand_dept"
        label="部门"
        width="180"
        margin-left:20px
        >
      </el-table-column>
      <el-table-column 
        prop="people_number"
        label="人数"
        width="180"
        margin-left:40px>
      </el-table-column>
       <el-table-column 
        prop="training_methods"
        label="培训方式"
        width="180"
        margin-left:40px>
      </el-table-column>
      <el-table-column
        prop="demand_reason"
        label="需求原因"
        width="180">
      </el-table-column>
      <el-table-column
        prop="other_requirements"
        label="其他需求"
        width="280">
      </el-table-column>
    </el-table>
      </div>
      </div>
      <div >
         <div v-for="(topic,index) in demands.etmsDemandResearch.etmsResachTopicList" :key="topic.index" class="aaa">
        <div style="font-size: 16px; color: #409EFF; margin-top: 25px; margin-left: 20px">
          {{index+1}}、{{topic.index}}{{topic.topicName}}
        </div>
        <div v-for="(anwer,index) in topic.etmsResachAnwers" :key="anwer.index" >
          <div style="font-size: 16px; color: #909399; margin-top: 25px; margin-left: 20px">
            {{index+1}}-{{anwer.answerContent}}({{anwer.nums}})
            <upload style="float: right"></upload>
          </div>
        </div> 
      </div>
      </div>
    </el-aside>
  </el-container>
</div>
</template>

<script>
import {detailShow} from '@/api/detailsShow'
export default {
  data() {
    return {
      demands: {},
      demandTableId: 0,
      
    }
  },
  created() {
    this.demandTableId = this.$route.params.demandTableId
    this.getData();
  },
  methods: {
    getData(){
      //console.log(this.demands);
      detailShow(this.demandTableId).then(res => {
        //console.log(res);
        //console.log(data)
        this.demands = res.data;
        //console.log(this.demands.demandTitle)
        console.log(this.data.demandTitle)
        this.tableData[0].demandTitle=this.demands.demandTitle;
        this.tableData[0].demand_instructions=this.demands.demandInstructions;
        this.tableData[0].status=this.demands.status;
        this.tableData[0].date=this.demands.endTime;
        this.tableData[0].demand_dept=this.demands.demandDept;
        this.tableData[0].people_number=this.demands.peopleNumber;
        this.tableData[0].training_methods=this.demands.trainingMethods;
        this.tableData[0].demand_reason=this.demands.demandReason;
        this.tableData[0].other_requirements=this.demands.otherRequirements;
      })
    }
  }
}
</script>
<style scoped>
.aaa{
  display: flex;
  margin-left: 20px;
}
</style>
